import React from 'react'
import HYDiscover from '@/pages/discover'
import HYFriend from '@/pages/friend'
import HYMine from '@/pages/mine'
import HYDownload from '@/pages/download'

import HYAblum from '@/pages/discover/childComp/album'
import HYArtist from '@/pages/discover/childComp/artist'
import HYDjradio from '@/pages/discover/childComp/djradio'
import HYRanking from '@/pages/discover/childComp/ranking'
import HYRecommend from '@/pages/discover/childComp/recommend'
import HYSongs from '@/pages/discover/childComp/songs'


import { Redirect } from 'react-router-dom'
const routes=[
    { 
        path: '/',
        exact:true,
        render:()=><Redirect to='/discover'/> 
    },
    { 
        path: '/discover',
        component: HYDiscover,
        routes:[
        { 
            path: '/discover', 
            exact:true,
            render: () => (
                <Redirect to={"/discover/recommend"}/>
              )
        },
        {
            path:'/discover/recommend',
            component:HYRecommend
        },
        { 
            path: "/discover/ranking",
            component: HYRanking
        },
        {
            path: "/discover/songs",
            component: HYSongs
          },
          {
            path: "/discover/djradio",
            exact: true,
            component: HYDjradio
          },
          {
            path: "/discover/artist",
            component: HYArtist
          },
          {
            path: "/discover/album",
            component: HYAblum
          },
        
    ]
},
    { path: '/friend', component: HYFriend},
    { path: '/mine', component: HYMine},
    { path: '/download', component:HYDownload}

];
export default routes;